package com.xls.box2023.adapter;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.lzz.bottomencapsulation.holder.MvpRVViewHolder;
import com.xls.box2023.R;
import com.xls.box2023.entity.TiXianJiLuEntity;

public class TiXianJiLuViewHolder extends MvpRVViewHolder<TiXianJiLuEntity> {
    private TextView tixianjilu_time;
    private TextView tixianjilu_title_1;
    private TextView tixianjilu_jibi_num;
    private ImageView tixianjilu_tixianzhuangtai;

    public TiXianJiLuViewHolder(Context context, ViewGroup p) {
        super(R.layout.item_tixianjilu, context, p);
    }

    @Override
    public void initView() {

        tixianjilu_time = itemView.findViewById(R.id.tixianjilu_time);
        tixianjilu_title_1 = itemView.findViewById(R.id.tixianjilu_title_1);
        tixianjilu_jibi_num = itemView.findViewById(R.id.tixianjilu_jibi_num);
        tixianjilu_tixianzhuangtai = itemView.findViewById(R.id.tixianjilu_tixianzhuangtai);

        tixianjilu_time.setText(viewData.getCreateTime());
        tixianjilu_jibi_num.setText(viewData.getCoins()+ " 金币");

            if (viewData.getStatus()==0){
                tixianjilu_tixianzhuangtai.setImageResource(com.xls.resource.R.drawable.ic_state_tixian0);
            }else if (viewData.getStatus()==-1){
                tixianjilu_tixianzhuangtai.setImageResource(com.xls.resource.R.drawable.ic_state_tixian3);//
            }else if (viewData.getStatus()==1){
                if (viewData.getPayStatus()==1){
                    tixianjilu_tixianzhuangtai.setImageResource(com.xls.resource.R.drawable.ic_state_tixian1);
                }else {
                    tixianjilu_tixianzhuangtai.setImageResource(com.xls.resource.R.drawable.ic_state_tixian0);
            }
        }
    }
}
